
package me.zhengjie.modules.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.NotBlank;

/**
* @description /
* @author ck
* @date 2025-02-11
**/
@Data
@TableName("pet_categories")
public class PetCategories implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Integer id;

    @NotBlank
    @ApiModelProperty(value = "类别名称")
    private String name;

    @ApiModelProperty(value = "类别图片URL")
    private String imageUrl;

    @ApiModelProperty(value = "类别描述")
    private String description;

    @ApiModelProperty(value = "平均寿命")
    private String averageLifeSpan;

    @ApiModelProperty(value = "护理频率编码")
    private String groomingFrequencyCode;

    @ApiModelProperty(value = "常见健康问题")
    private String commonHealthIssues;

    @ApiModelProperty(value = "排序号")
    private Integer sortOrder;

    @ApiModelProperty(value = "是否启用 0-禁用 1-启用")
    private Integer isActive;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createdAt;

    @ApiModelProperty(value = "更新时间")
    private Timestamp updatedAt;

    @TableField(exist = false)
    private Boolean hasChildren;

    public void copy(PetCategories source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
